package com.data.center.entity.mongo;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Field;

import java.time.LocalDateTime;
@Data
@NoArgsConstructor
@Document(collection = "staff")
public class MongoStaff {


        @Id // MongoDB 自动生成的唯一标识符
        private String id;

        @Field("staff_id") // 对应 MongoDB 文档中的字段
        private String staffId;

        @Field("organization_id")
        private String organizationId;

        @Field("name")
        private String name;

        @Field("mobile")
        private String mobile;

        @Field("telephone")
        private String telephone;

        @Field("email")
        private String email;

        @Field("fax")
        private String fax;

        @Field("position")
        private String position;

        @Field("status")
        private String status;

        @Field("creator")
        private String creator;

        @Field("creation_time")
        private LocalDateTime creationTime;

        @Field("modifier")
        private String modifier;

        @Field("last_modified_time")
        private LocalDateTime lastModifiedTime;

        // 全参构造函数
        public MongoStaff(String staffId, String organizationId, String name, String mobile, String telephone,
                     String email, String fax, String position, String status, String creator,
                     LocalDateTime creationTime, String modifier, LocalDateTime lastModifiedTime) {
            this.staffId = staffId;
            this.organizationId = organizationId;
            this.name = name;
            this.mobile = mobile;
            this.telephone = telephone;
            this.email = email;
            this.fax = fax;
            this.position = position;
            this.status = status;
            this.creator = creator;
            this.creationTime = creationTime;
            this.modifier = modifier;
            this.lastModifiedTime = lastModifiedTime;
        }

        @Override
        public String toString() {
            return "Staff{" +
                    "id='" + id + '\'' +
                    ", staffId='" + staffId + '\'' +
                    ", organizationId='" + organizationId + '\'' +
                    ", name='" + name + '\'' +
                    ", mobile='" + mobile + '\'' +
                    ", telephone='" + telephone + '\'' +
                    ", email='" + email + '\'' +
                    ", fax='" + fax + '\'' +
                    ", position='" + position + '\'' +
                    ", status='" + status + '\'' +
                    ", creator='" + creator + '\'' +
                    ", creationTime=" + creationTime +
                    ", modifier='" + modifier + '\'' +
                    ", lastModifiedTime=" + lastModifiedTime +
                    '}';
        }

}
